package com.we823.cms.controller.front;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.we823.cms.common.WebConstants;
import com.we823.cms.common.web.FrontUtils;

@Controller
public class IndexController {

	private String baseUrl = WebConstants.WEB_TEMPLATE_PREFIX;
	
	@RequestMapping("index")
	public String index(Model model){
		return FrontUtils.buildIndexTemplateUrl(baseUrl,model);
	}
	
	@RequestMapping("refresh")
	public String refresh(HttpServletRequest request,Model model){
		frontUtils.refresh();
		return FrontUtils.buildIndexTemplateUrl(baseUrl, model);
	}
	@Autowired
	
	private FrontUtils frontUtils = null;

	public FrontUtils getFrontUtils() {
		return frontUtils;
	}

	public void setFrontUtils(FrontUtils frontUtils) {
		this.frontUtils = frontUtils;
	}
	
}
